/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package syslivros;

import java.awt.event.KeyEvent;
import javax.swing.JOptionPane;

/**
 *
 * @author Rafael
 */
public class Catis extends javax.swing.JFrame {

    /**
     * Creates new form Catis
     */
    public Catis() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnVotar = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        btnExcluirCatis = new javax.swing.JButton();
        btnCadastrarCatis = new javax.swing.JButton();
        btnAtualizarCatis = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Locais de Aula");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        btnVotar.setText("Voltar");
        btnVotar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVotarActionPerformed(evt);
            }
        });
        btnVotar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnVotarKeyPressed(evt);
            }
        });

        btnExcluirCatis.setText("Excluir Catis");
        btnExcluirCatis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExcluirCatisActionPerformed(evt);
            }
        });
        btnExcluirCatis.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnExcluirCatisKeyPressed(evt);
            }
        });

        btnCadastrarCatis.setText("Cadastrar Catis ");
        btnCadastrarCatis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCadastrarCatisActionPerformed(evt);
            }
        });
        btnCadastrarCatis.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnCadastrarCatisKeyPressed(evt);
            }
        });

        btnAtualizarCatis.setText("Atualizar Catis");
        btnAtualizarCatis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAtualizarCatisActionPerformed(evt);
            }
        });
        btnAtualizarCatis.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btnAtualizarCatisKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(btnCadastrarCatis)
                .addGap(47, 47, 47)
                .addComponent(btnAtualizarCatis)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnExcluirCatis))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(40, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnExcluirCatis)
                    .addComponent(btnCadastrarCatis)
                    .addComponent(btnAtualizarCatis))
                .addGap(37, 37, 37))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 360, Short.MAX_VALUE)
                        .addComponent(btnVotar))
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(90, Short.MAX_VALUE)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(76, 76, 76)
                .addComponent(btnVotar)
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-457)/2, (screenSize.height-338)/2, 457, 338);
    }// </editor-fold>//GEN-END:initComponents

    private void btnCadastrarCatisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCadastrarCatisActionPerformed

        new CadastrarCatis().setVisible(true);
this.dispose();
    }//GEN-LAST:event_btnCadastrarCatisActionPerformed

    private void btnCadastrarCatisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnCadastrarCatisKeyPressed
      if(evt.getKeyCode()==KeyEvent.VK_ENTER){
      btnCadastrarCatisActionPerformed(null);
      }
    }//GEN-LAST:event_btnCadastrarCatisKeyPressed

    private void btnExcluirCatisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirCatisActionPerformed
    new ExcluirCatis().setVisible(true);
    this.dispose();
    }//GEN-LAST:event_btnExcluirCatisActionPerformed

    private void btnExcluirCatisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnExcluirCatisKeyPressed
if(evt.getKeyCode()==KeyEvent.VK_ENTER){
btnExcluirCatisActionPerformed(null);
}
    }//GEN-LAST:event_btnExcluirCatisKeyPressed

    private void btnVotarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVotarActionPerformed
new Principal().setVisible(true);
this.dispose();
    }//GEN-LAST:event_btnVotarActionPerformed

    private void btnVotarKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnVotarKeyPressed
if(evt.getKeyCode()==KeyEvent.VK_ENTER){
btnVotarActionPerformed(null);
}
    }//GEN-LAST:event_btnVotarKeyPressed

    private void btnAtualizarCatisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtualizarCatisActionPerformed
new AtualizarCatis().setVisible(true);
this.dispose();
    }//GEN-LAST:event_btnAtualizarCatisActionPerformed

    private void btnAtualizarCatisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnAtualizarCatisKeyPressed
if(evt.getKeyCode()==KeyEvent.VK_ENTER){
btnAtualizarCatisActionPerformed(null);
}
    }//GEN-LAST:event_btnAtualizarCatisKeyPressed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

    }//GEN-LAST:event_formWindowOpened

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Catis().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnAtualizarCatis;
    private javax.swing.JButton btnCadastrarCatis;
    private javax.swing.JButton btnExcluirCatis;
    private javax.swing.JButton btnVotar;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
